185 research outputs found
Type Classes for Lightweight Substructural Types
Linear and substructural types are powerful tools, but adding them to
standard functional programming languages often means introducing extra
annotations and typing machinery. We propose a lightweight substructural type
system design that recasts the structural rules of weakening and contraction as
type classes; we demonstrate this design in a prototype language, Clamp.
Clamp supports polymorphic substructural types as well as an expressive
system of mutable references. At the same time, it adds little additional
overhead to a standard Damas-Hindley-Milner type system enriched with type
classes. We have established type safety for the core model and implemented a
type checker with type inference in Haskell.Comment: In Proceedings LINEARITY 2014, arXiv:1502.0441
Recommended from our members
Typed Closure Conversion
Closure conversion is a program transformation used by compilers to separate code from data. Previous accounts of closure conversion use only untyped target languages. Recent studies show that translating to typed target languages is a useful methodology for building compilers, because a compiler can use the types to implement efficient data representations, calling conventions, and tag-free garbage collection. Furthermore, type-based translations facilitate security and debugging through automatic type checking, as well as correctness arguments through the method of logical relations. We present closure conversion as a type-directed, and type preserving translation for both the simply-typed and the polymorphic λ--calculus. Our translations are based on a simple "closures as objects" principle: higher-order functions are viewed as objects consisting of a single method (the code) and a single instance variable (the environment). In the simply-typed case, the Pierce-Turner model of object typing where objects are packages of existential type suffices. In the polymorphic case, more careful tracking of type sharing is required. We exploit a variant of the Harper-Lillibridge "translucent type" formalism to characterize the types of polymorphic closures.Engineering and Applied Science
Interval Parsing Grammars for File Format Parsing
File formats specify how data is encoded for persistent storage. They cannot
be formalized as context-free grammars since their specifications include
context-sensitive patterns such as the random access pattern and the
type-length-value pattern. We propose a new grammar mechanism called Interval
Parsing Grammars IPGs) for file format specifications. An IPG attaches to every
nonterminal/terminal an interval, which specifies the range of input the
nonterminal/terminal consumes. By connecting intervals and attributes, the
context-sensitive patterns in file formats can be well handled. In this paper,
we formalize IPGs' syntax as well as its semantics, and its semantics naturally
leads to a parser generator that generates a recursive-descent parser from an
IPG. In general, IPGs are declarative, modular, and enable termination
checking. We have used IPGs to specify a number of file formats including ZIP,
ELF, GIF, PE, and part of PDF; we have also evaluated the performance of the
generated parsers.Comment: To appear on PLDI'2
08061 Abstracts Collection -- Types, Logics and Semantics for State
From 3 February to 8 February 2008, the Dagstuhl Seminar 08061
``Types, Logics and Semantics for State\u27\u27 was held in the
International Conference and Research Center (IBFI), Schloss Dagstuhl.
During the seminar, several participants presented their current
research, and ongoing work and open problems were discussed. Abstracts
of the presentations given during the seminar as well as abstracts of
seminar results and ideas are put together in this paper. The first
section describes the seminar topics and goals in general. Links to
extended abstracts or full papers are provided, if available
08061 Executive Summary -- Types, Logics and Semantics for State
From 3 February to 8 February 2008, the Dagstuhl Seminar
08061 State" Conference and Research Center (IBFI), Schloss Dagstuhl.
45 researchers, with interests and expertise in many different aspects
of modelling and reasoning about mutable state, met to present their
current work and discuss ongoing projects and open problems
A Realizability Model for Impredicative Hoare Type Theory
We present a denotational model of impredicative Hoare Type Theory, a very expressive dependent type theory in which one can specify and reason about mutable abstract data types.
The model ensures soundness of the extension of Hoare Type Theory with impredicative polymorphism; makes the connections to separation logic clear, and provides a basis for investigation of further sound extensions of the theory, in particular equations between computations and types.Engineering and Applied Science
Recommended from our members
Toward a verified relational database management system
We report on our experience implementing a lightweight, fully verified relational database management system (RDBMS). The functional specification of RDBMS behavior, RDBMS implementation, and proof that the implementation meets the specification are all written and verified in Coq. Our contributions include: (1) a complete specification of the relational algebra in Coq; (2) an efficient realization of that model (B+ trees) implemented with the Ynot extension to Coq; and (3) a set of simple query optimizations that are proven to respect both semantics and run-time cost. In addition to describing the design and implementation of these artifacts, we highlight the challenges we encountered formalizing them, including the choice of representation for (finite) relations of typed tuples and the challenges of reasoning about data structures with complex sharing. Our experience shows that though many challenges remain, building fully-verified systems software in Coq is within reach.Engineering and Applied Science
- …